{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('/admin/agent')}">渠道游戏管理</a></li>
            <li class="layui-this">添加渠道游戏</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('/admin/agent/save')}" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">选择游戏</label>
                        <div class="layui-input-block">
                            <select name="gid" lay-search>
                                <option value="0">选择游戏</option>
                                {foreach name=":get_game_list()" item="vo"}
                                    <option value="{$vo.id}">{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">选择渠道</label>
                        <div class="layui-input-block">
                            <select name="cid" lay-search>
                                <option value="0">选择渠道</option>
                                {foreach name=":get_channel_list()" item="vo"}
                                    <option value="{$vo.id}">{$vo.platform}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="0" title="关闭" >
                            <input type="radio" name="status" value="1" title="开启" checked="checked">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
	
	layui.use('form', function(){
  var form = layui.form
   ,layer = layui.layer
  ,layedit = layui.layedit;
      laydate = layui.laydate;
	//时间选择器
	var start = laydate.render({
	                    elem: '#stime',
	                    type: 'datetime',
	                    format: 'yyyy-MM-dd HH:mm:ss',
	                    done: function(value, date, endDate) {
	                        start.config.max = {
	                            year: date.year,
	                            month: date.month - 1,
	                            date: date.date,
	                            hours: date.hours,
	                            minutes: date.minutes,
	                            seconds: date.seconds
	                        }
	                    }
	                });
	var end = laydate.render({
	                    elem: '#otime',
	                    type: 'datetime',
	                    format: 'yyyy-MM-dd HH:mm:ss',
	                    done: function(value, date, endDate) {
	                        start.config.max = {
	                            year: date.year,
	                            month: date.month - 1,
	                            date: date.date,
	                            hours: date.hours,
	                            minutes: date.minutes,
	                            seconds: date.seconds
	                        }
	                    }
	                });
    var apply = laydate.render({
        elem: '#atime',
        type: 'datetime',
        format: 'yyyy-MM-dd HH:mm:ss',
        done: function(value, date, endDate) {
            start.config.max = {
                year: date.year,
                month: date.month - 1,
                date: date.date,
                hours: date.hours,
                minutes: date.minutes,
                seconds: date.seconds
            }
        }
    });
});
	
</script>
{/block}